import request from '@/config/axios'

// 企业积分发放规则 VO
export interface CompanyScoreRuleVO {
  id: number // 任务编号
  companyId: number // 企业ID
  postId: number // 岗位ID
  postName: string // 岗位名称
  pk: string // 规则名称
  intro: string // 备注
  score: number // 积分
}

// 企业积分发放规则 API
export const CompanyScoreRuleApi = {
  // 查询企业积分发放规则分页
  getCompanyScoreRulePage: async (params: any) => {
    return await request.get({ url: `/dlbz/company-score-rule/page`, params })
  },

  // 查询企业积分发放规则详情
  getCompanyScoreRule: async (id: number) => {
    return await request.get({ url: `/dlbz/company-score-rule/get?id=` + id })
  },

  // 新增企业积分发放规则
  createCompanyScoreRule: async (data: CompanyScoreRuleVO) => {
    return await request.post({ url: `/dlbz/company-score-rule/create`, data })
  },

  // 修改企业积分发放规则
  updateCompanyScoreRule: async (data: CompanyScoreRuleVO) => {
    return await request.put({ url: `/dlbz/company-score-rule/update`, data })
  },

  // 删除企业积分发放规则
  deleteCompanyScoreRule: async (id: number) => {
    return await request.delete({ url: `/dlbz/company-score-rule/delete?id=` + id })
  },

  // 导出企业积分发放规则 Excel
  exportCompanyScoreRule: async (params) => {
    return await request.download({ url: `/dlbz/company-score-rule/export-excel`, params })
  }
}